﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PersistentObject.Common.Sorts
{
    /// <summary>
    /// Represent a property in ORDERBY
    /// </summary>
    public class OrderByProperty : OrderBy
    {
        /// <summary>
        /// Indicate the property name
        /// </summary>
        public string PropertyName { get; private set; }
        /// <summary>
        /// Indicate the type of ORDERBY
        /// </summary>
        public OrderByType Type { get; private set; }

        public string Decoration { get; set; }

        /// <summary>
        /// Initialize a property ORDERBY instance with a property name
        /// </summary>
        /// <param name="propertyName"></param>
        public OrderByProperty(string propertyName)
            :this(propertyName, OrderByType.ASC)
        {
        }

        /// <summary>
        /// Initialize a property ORDERBY instance
        /// </summary>
        /// <param name="propertyName"></param>
        /// <param name="type"></param>
        public OrderByProperty(string propertyName, OrderByType type)
        {
            PropertyName = propertyName;
            Type = type;
            Decoration = "{0}";
        }
    }
}
